package com.aplink.generic.pojo.controlspec.spinner;

import android.text.TextUtils;

import com.aplink.generic.pojo.controlspec.ControlSpec;
import com.aplink.generic.util.ResourcesHelper;

public class SpinnerSpec extends ControlSpec {
	private static final long serialVersionUID = -8921517653100040165L;
	private String displayProperty;
	private boolean isAddBlank;
	private String mAddNewRecord;
	private String mContentData;
	private String mPromptTitle;
	private String mRowItem;
	private String mRptrdesign;
	private String mSearchField;
	private SpinnerMode mSpinnerMode;
	private String mValueProp;

	public String getContentData() {
		return this.mContentData;
	}

	public int getContentDataID() {
		return ResourcesHelper.getRawIdByName(this.mContentData);
	}

	public String getDisplayProperty() {
		return this.displayProperty;
	}

	public String getNewRowItem() {
		return this.mAddNewRecord;
	}

	public String getPromptTitle() {
		return this.mPromptTitle;
	}

	public String getRowItem() {
		return this.mRowItem;
	}

	public String getRptrdesign() {
		return this.mRptrdesign;
	}

	public int getRptrdesignID() {
		return ResourcesHelper.getRawIdByName(this.mRptrdesign);
	}

	public String getSearchField() {
		return this.mSearchField;
	}

	public SpinnerMode getSpinnerMode() {
		return this.mSpinnerMode;
	}

	public String getValueProp() {
	    return mValueProp;
    }

	public String initContentData() {
		return this.mContentData;
	}

	public boolean isAddBlank() {
		return this.isAddBlank;
	}

	public boolean isHasNewRowItem() {
		return !TextUtils.isEmpty(this.mAddNewRecord);
	}

	public void setAddBlank(final boolean isAddblank) {
		this.isAddBlank = isAddblank;
	}

	public void setContentData(final String contentData) {
		this.mContentData = contentData;
	}

	public void setDisplayProperty(final String displayProperty) {
		this.displayProperty = displayProperty;
	}

	public void setNewRowItem(final String addNewRecord) {
		this.mAddNewRecord = addNewRecord;
	}

	public void setPromptTitle(final String promptTitle) {
		this.mPromptTitle = promptTitle;
	}

	public void setRowItem(final String rowItem) {
		this.mRowItem = rowItem;
	}

	public void setRptrdesign(final String rptrdesign) {
		this.mRptrdesign = rptrdesign;
	}

	public void setSearchField(final String searchField) {
		this.mSearchField = searchField;
	}

	public void setSpinnerMode(final String title) {
		this.mSpinnerMode = SpinnerMode.get(title);
	}

	public void setValueProp(String valueProp) {
	    mValueProp = valueProp;
    }

}
